package dao.member;

import vo.MemberVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class MemberDAOImpl implements MemberDAO {
	
	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}
	
	@Override
	public MemberVO login(String member_id) throws Exception {
		return (MemberVO) sqlMapClient.queryForObject("member.login",member_id);
	}

	@Override
	public int isMember(String member_mail) throws Exception {
		return (int) sqlMapClient.queryForObject("member.isMember",member_mail);
	}

	@Override
	public int registerMember(MemberVO param) throws Exception {
		return (Integer) sqlMapClient.insert("member.registerMember",param);
	}

	@Override
	public int updatePass(MemberVO param) throws Exception {
		return sqlMapClient.update("member.updatePass", param);
	}

	@Override
	public void deleteMember(int member_no) throws Exception {
		sqlMapClient.update("member.deleteMember", member_no);
	}
}
